#include "api\stdafx.hpp"
#include "api\graphic_connector.hpp"
#include "api\grc_geometryengine.hpp"

#include <QtCore\qplugin.h>

namespace GraphicConnector {

class GraphicConnectorPluginInstance
	:	public GraphicConnectorPlugin
{
public:
	GraphicConnectorPluginInstance()
	{
	}

	IGeometryEngine& getGeometryEngine( QWidget* _parent )
	{
		if ( !m_geometryEngine )
			m_geometryEngine.reset( new GeometryEngine( _parent ) );
		return *m_geometryEngine;
	}

	std::shared_ptr< GeometryEngine > m_geometryEngine;

};

Q_EXTERN_C GRAPHIC_CONNECTOR_EXPORT GraphicConnectorPlugin* getGraphicConnectorPlugin()
{
	return new GraphicConnectorPluginInstance;
}

} // namespace GraphicConnector
